<!--conf
<sample in_favorites="false">
              <product version="1.4" edition="pro"/>
                     <modifications>
                            <modified date="070101"/>
                     </modifications>
               </sample>
 --> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Hide/Show column </title>
	
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
</head>

<body>
	
	<h1>Hide/Show column</h1>
	<p>Any column can be hidden/shown by API calling:</p>
	<table width="600">
		<tr>
			<td width="50%" valign="top">
				<div id="gridbox" style="width:100%;height:270px;background-color:white;"></div>
			</td>

		</tr>
		<tr>
			<td>
				<p><a href="#" onClick="mygrid.setColumnHidden(this.nextSibling.value,true)">Hide column with index</a><select>
				    <option value="0">0</option>
				    <option value="1">1</option>
				    <option value="2">2</option>
				    <option value="3">3</option>
				    <option value="4">4</option>
				    <option value="5">5</option>
			      </select>
				  <br>
				  <a href="#" onClick="mygrid.setColumnHidden(this.nextSibling.value,false)">Show column with index</a><select>
				    <option value="0">0</option>
				    <option value="1">1</option>
				    <option value="2">2</option>
				    <option value="3">3</option>
				    <option value="4">4</option>
				    <option value="5">5</option>
			      </select>
			  </p>
				<p>Check whether selected column is hidden:<br>
				  <a href="#" onClick="alert(mygrid.isColumnHidden(this.nextSibling.value))">Is column hidden </a><select>
				    <option value="0">0</option>
				    <option value="1">1</option>
				    <option value="2">2</option>
				    <option value="3">3</option>
				    <option value="4">4</option>
				    <option value="5">5</option>
			      </select>
				  <br>
		    </p></td>
		</tr>
	</table>
<br>


<script>
	mygrid = new dhtmlXGridObject('gridbox');
	mygrid.setImagePath("../../../codebase/imgs/");
	mygrid.setHeader("Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
	mygrid.setInitWidths("50,150,120,80,80,80,80,200")
	mygrid.setColAlign("right,left,left,right,center,left,center,center")
	mygrid.setColTypes("dyn,ed,ed,price,ch,co,ra,ro");
    mygrid.getCombo(5).put(2,2);
	mygrid.setColSorting("int,str,str,int,str,str,str,date")
	mygrid.init();
	mygrid.setSkin("dhx_skyblue");
	mygrid.loadXML("../common/grid_16_rows_columns_manipulations.xml");
	


	
</script>

</body>
</html>
